home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / bit / src / gui.h < prev    next >
C/C++ Source or Header  |  1994-08-01  |  11KB  |  331 lines

  1. /*
  2.  * $Id: gui.h,v 0.91 1994/02/20 00:53:39 zhao Pre-Release $
  3.  *
  4.  *. This file is part of BIT shareware package. After the two weeks of
  5.  *  free evaluation period, you are encouraged (required) to register
  6.  *  your copy for a small registration fee, which is $35 for personal use
  7.  *  and $50 for commercial, government and institutional use.
  8.  *
  9.  *  Copyright(c) 1993, 1994 by T.C. Zhao.
  10.  *  All rights reserved.
  11.  *
  12.  *  Permission to use, copy, and distribute this software in its entirety
  13.  *  for non-commercial purposes is hereby granted, provided that the
  14.  *  above shareware and copyright notices and this permission notice
  15.  *  appear in all copies and their documentation.
  16.  *
  17.  *  This software may be modified for your own use, but modified versions
  18.  *  may not be distributed without prior consent of the author.
  19.  *
  20.  *  This software is provided "as is" without expressed or implied
  21.  *  warranty of any kind.
  22.  *
  23.  *.
  24.  *
  25.  * graphics interface utility defines and macros, most related to forms
  26.  */
  27.  
  28. #ifndef BIT_GUI_H
  29. #define BIT_GUI_H
  30.  
  31. #include "gl/gl.h"
  32. #include "gl/device.h"
  33. #include "forms.h"
  34. #include "utype.h"
  35.  
  36. /* FORM_CLASS XYPLOT */
  37. #ifndef FORM_XYPLOT_H_
  38. #define FORM_XYPLOT_H_
  39.  
  40. #define    FL_XYPLOT     63
  41.  
  42. /***********   type ***************/
  43. #define FL_LINE_XYPLOT          0
  44. #define FL_DASHED_XYPLOT        1
  45. #define FL_DOTTED_XYPLOT        2
  46. #define FL_POINTS_XYPLOT        3
  47. #define FL_CIRCLE_XYPLOT        4
  48. #define FL_SQUARE_XYPLOT        5
  49. #define FL_LINEPOINT_XYPLOT     6
  50. #define FL_LINECIRCLE_XYPLOT    7
  51. #define FL_LINESQUARE_XYPLOT    8
  52. #define FL_IMPULSE_XYPLOT       9
  53. #define FL_IMPULSELINE_XYPLOT   10
  54. #define FL_LINEFILL_XYPLOT      11
  55. #define FL_ACTIVE_XYPLOT        12
  56. #define FL_XYPLOT_MAXTYPE       13
  57.  
  58. /***** Defaults *****/
  59.  
  60. #define FL_XYPLOT_BOXTYPE       FL_BORDER_BOX
  61. #define FL_XYPLOT_COL1          FL_COL1
  62. #define FL_XYPLOT_LCOL          FL_LCOL
  63. #define FL_XYPLOT_ALIGN         FL_ALIGN_BOTTOM
  64.  
  65. /***** Others   *****/
  66.  
  67. #define FL_XYPLOT_BW            FL_BOUND_WIDTH
  68.  
  69. /* prototypes */
  70. extern FL_OBJECT *fl_create_xyplot(int, float, float, float, float, const
  71.                    char *);
  72. extern FL_OBJECT *fl_add_xyplot(int, float, float, float, float, const char *);
  73. extern void fl_clear_xyplot(FL_OBJECT *);
  74. extern void fl_clear_xyplot_text(FL_OBJECT *);
  75. extern void fl_set_xyplot(FL_OBJECT *, float *, float *, int,
  76.               const char *, const char *, const char *);
  77. extern void fl_set_xyplot_only(FL_OBJECT *, float *, float *, int,
  78.                    const char *, const char *, const char *);
  79. extern void fl_set_xyplot_xbounds(FL_OBJECT *, float, float);
  80. extern void fl_set_xyplot_ybounds(FL_OBJECT *, float, float);
  81. extern void fl_set_xyplot_point(FL_OBJECT *, float, float, int);
  82. extern void fl_set_xyplot_autobounds(FL_OBJECT *, int, int);
  83. extern void fl_set_xyplot_xscale(FL_OBJECT *, int, int);
  84. extern void fl_set_xyplot_yscale(FL_OBJECT *, int, int);
  85. extern void fl_set_xyplot_colors(FL_OBJECT *, int, int);
  86. extern void fl_set_xyplot_legend(FL_OBJECT *, int);
  87. extern void fl_set_xyplot_lstyle(FL_OBJECT *, int);
  88. extern void fl_set_xyplot_lsize(FL_OBJECT *, float);
  89. extern void fl_set_xyplot_type(FL_OBJECT *, int);
  90. extern void fl_get_xyplot(FL_OBJECT *, float *, float *, int *);
  91. extern void fl_get_active_xyplot(FL_OBJECT *, float *, float *, int *);
  92. extern void fl_set_xyplot_return(FL_OBJECT *, int);
  93. extern void fl_set_xyplot_text(FL_OBJECT *, float x, float y, int,
  94.                    const char *, int, int, float, int);
  95. extern void fl_add_xyplot_text(FL_OBJECT *, float x, float y, int,
  96.                    const char *, int, int, float, int);
  97. #endif /* FORM_XYPLOT_H */
  98.  
  99. /* RGB_ICON class */
  100.  
  101. #define FL_RGB_ICON      64
  102. #define FL_NORMAL_ICON   FL_NORMAL_BUTTON
  103. #define FL_RADIO_ICON    FL_RADIO_BUTTON
  104. #define FL_PUSH_ICON     FL_PUSH_BUTTON
  105. #define FL_TOUCH_ICON    FL_TOUCH_BUTTON
  106. #define FL_DBL_CLK_ICON  4
  107.  
  108. /* some default */
  109. #define FL_ICON_BOXTYPE  FL_FLAT_BOX
  110. #define FL_ICON_LCOL     FL_BLUE
  111. #define FL_ICON_LSIZE    12.0
  112. #define FL_ICON_ALIGN    FL_ALIGN_CENTER
  113. #define FL_ICON_LSTYLE   FL_BOLD_STYLE
  114.  
  115. extern FL_OBJECT *fl_add_icon(int, float, float, float, float, const char *);
  116. extern FL_OBJECT *fl_set_icon_file(FL_OBJECT *, const char *);
  117. extern FL_OBJECT *fl_set_icon_bitmap(FL_OBJECT *, int, int, rgba_t **, int);
  118.  
  119. extern void fl_set_icon_info(FL_OBJECT *, const char *);
  120. extern const char *fl_get_icon_info(FL_OBJECT *);
  121.  
  122. extern int fl_get_icon(FL_OBJECT *);
  123. extern int fl_get_icon_dblclk(FL_OBJECT *);
  124. extern void fl_set_icon(FL_OBJECT *, int);
  125.  
  126. /* END of RGB_ICON */
  127.  
  128. /****************** Active BITMAP class ***************/
  129. #include "bit.h"
  130.  
  131. #define FL_ACTIVE_BITMAP   65
  132. #define FL_PUSH_BITMAP     FL_PUSH_BUTTON
  133. #define FL_RADIO_BITMAP    FL_RADIO_BUTTON
  134.  
  135. /**** Default ****/
  136. #define FL_ACTIVE_BITMAP_BOXTYPE   FL_UP_BOX
  137. #define FL_ACTIVE_BITMAP_COL1      FL_COL1
  138. #define FL_ACTIVE_BITMAP_COL2      FL_COL2
  139. #define FL_ACTIVE_BITMAP_BW        2.0
  140.  
  141. /**** Routines ***********/
  142.  
  143. extern FL_OBJECT *fl_add_active_bitmap(int, float, float, float, float,
  144.                        const char *);
  145. extern int fl_get_active_bitmap(FL_OBJECT *);
  146. extern void fl_set_active_bitmap(FL_OBJECT *, int);
  147. extern FL_OBJECT *fl_set_bitmap_bitmap(FL_OBJECT *, int, int, char *);
  148. extern void fl_set_active_bitmap_color(FL_OBJECT *, int);
  149.  
  150.  
  151. /******* END of CLASS FL_ACTIVE_BITMAP ********/
  152.  
  153.  
  154. #ifndef TC_NORMAL_SIZE
  155. #define TC_SMALL_SIZE    10.0
  156. #define TC_NORMAL_SIZE   11.0
  157. #define TC_MEDIUM_SIZE   14.0
  158. #define TC_LARGE_SIZE    16.0
  159. #endif
  160.  
  161. /*
  162.  * get the forms index and remap the color to the correct one for some X
  163.  * software left the colormap screwed-up
  164.  */
  165. #ifndef FL_COLOR_RE_DEF
  166. #define FL_COLOR_RE_DEF
  167.  
  168. #define FL_BLACK       0
  169. #define FL_RED         1
  170. #define FL_GREEN       2
  171. #define FL_YELLOW      3
  172. #define FL_BLUE        4
  173. #define FL_MAGENTA     5
  174. #define FL_CYAN        6
  175. #define FL_WHITE       7
  176. #define FL_INACTIVE    8
  177. #define FL_INDIANRED   9
  178. #define FL_SLATEBLUE  12
  179. #define FL_MAGIC1     47
  180. #define FL_MAGIC2     49
  181. #define FL_GRAY68     48
  182. #define FL_GRAY76     50
  183. #define FL_GRAY91     52
  184. #define FL_GRAY92     54
  185. #define FL_GRAY12     34
  186. #define FL_ORANGERED  91
  187. #define FL_DODGERBLUE 226
  188. #endif /* FL_COLOR_RE_DEF */
  189.  
  190. /* some short hand */
  191. #ifndef FL_SHORT_HAND_DEF
  192. #define FL_SHORT_HAND_DEF
  193.  
  194. #define FL_NB    FL_NORMAL_BUTTON
  195. #define FL_HB    FL_HIDDEN_BUTTON
  196. #define FL_TB    FL_TOUCH_BUTTON
  197. #define FL_RB    FL_RADIO_BUTTON
  198. #define FL_PB    FL_PUSH_BUTTON
  199. #define FL_RETB  FL_RETURN_BUTTON
  200.  
  201. #define FL_NC    FL_NORMAL_COUNTER
  202. #define FL_NT    FL_NORMAL_TEXT
  203. #define FL_NI    FL_NORMAL_INPUT
  204. #define FL_FI    FL_FLOAT_INPUT
  205. #define FL_NBM   FL_NORMAL_BITMAP
  206.  
  207. #define FL_HBR   FL_HOLD_BROWSER
  208. #define FL_NBR   FL_NORMAL_BROWSER
  209. #define FL_MBR   FL_MULTI_BROWSER
  210.  
  211. #define FL_HFS   FL_HOR_FILL_SLIDER
  212. #define FL_HNS   FL_HOR_NICE_SLIDER
  213.  
  214. #define FL_NCH   FL_NORMAL_CHOICE
  215. #endif
  216. extern void set_fl_free_default(FL_OBJECT *);
  217.  
  218. /* prototypes for basic utilites */
  219. extern FILE *get_BITfile_fp(const char *, const char *);
  220. extern FILE *get_HELPfile_fp(const char *, const char *);
  221. extern const char *get_TMPfile(const char *);
  222. extern FILE *get_TMPfile_fp(const char *, const char *);
  223. extern FILE *msg_fopen(const char *, const char *);
  224. extern void check_emergency(void);
  225. extern const char *get_HELPFile(const char *);
  226.  
  227. /**************************************************************
  228.  * Wrappers for FORMS
  229.  *************************************************************/
  230. extern long bit_show_form(FL_FORM *, int, int, const char *);
  231. extern void bit_hide_form(FL_FORM *);
  232. extern long bit_qread(short *);
  233. extern long bit_check_Q(short *);
  234. extern long bit_handle_event(long, short);
  235. extern long handle_const_q(long, short);
  236.  
  237. /* prototypes for functions */
  238.  
  239. extern void gui_init(void);
  240. extern int yes_no(const char *, const char *, const char *, int);
  241. extern int get_orientation(const char *, int *, int);
  242. extern void hide_orientation(void);
  243. extern void TC_continue(const char *, const char *, const char *, int);
  244. extern int getint(const char *, int *, int, int, int);
  245. extern int get2int(const char *, int *, int, int,
  246.            const char *, int *, int, int,
  247.            const char *, int *, int, int);
  248. extern int getfloat(const char *, float *, float, float, int, int);
  249.  
  250. /****** Read a string from keyboard *********/
  251. extern const char *getstring(const char *, const char *, int);
  252. extern void set_getstring_cb(void (*f) (const char *));
  253. extern void getstring_finish(void);
  254.  
  255. extern void set_message_color(int, int, int);
  256. extern void get_message_color(int *, int *, int *);
  257.  
  258. /* four charts for histograms */
  259. extern void show_chart4(const char *, float *, float *[], int);
  260. extern void set_chart4_help(int);
  261. extern void set_chart4_ybounds(float *, float *);
  262. extern void set_chart4_text(const char *, const char *, const char *,
  263.                 const
  264.                 char *);
  265. extern void set_chart4_ylabels(const char *, const char *, const char *,
  266.                    const
  267.                    char *);
  268. extern void set_chart4_style(long);
  269.  
  270. /* actions */
  271. extern int define_action(const char *, const char *);
  272. extern int addto_action(int, const char *, VLfptr);
  273. extern int do_action(int);
  274. extern void free_action(int);
  275. extern void free_all_actions(void);
  276.  
  277. /* options     */
  278. typedef int (*OptFunc) (int);
  279. extern int def_option(const char *, int, const char *);
  280. extern int set_option_act(int, const char *, OptFunc);
  281. extern int getopt_index(const char *);
  282. extern int addto_option(int, const char *, const char *, const char *, int *, const char *, VIIpfptr);
  283. extern int replace_option(int, int, int *, const char *);
  284. extern int do_option(int);
  285. extern void free_option(int);
  286. extern void free_all_options(void);
  287. extern int load_optfile(const char *, int);
  288.  
  289. extern void deactivate_all_forms(void);
  290.  
  291. extern void set_hand_cursor(long);
  292. extern void rubber_hide(void);
  293. extern void rubber_show(int);
  294.  
  295. extern void show_help(int, int, int, int, int);
  296. extern void add_to_help(const char *);
  297. extern void insert_help(const char *, int);
  298. extern void clear_help(void);
  299. extern void load_help(const char *, const char *);
  300. extern void help_cb(FL_OBJECT *, long);
  301. extern void print_help(const char *, const char *, int, int, int, int);
  302. extern void set_help_title(const char *);
  303.  
  304. extern int is_valid_win(long win);
  305. extern long myqread(short *, long, long);
  306. extern void show_busy(const char *);
  307. extern void end_busy(void);
  308. extern void rotate_cursor(void);
  309. extern void remove_rotate_cursor(void);
  310. extern void fl_set_form_hotspot(FL_FORM *, float, float);
  311. extern const char *getfilename(const char *, const char *,
  312.                    const char *, const char *, int);
  313.  
  314. /* from file control.c */
  315. extern long get_control_wid(void);
  316. extern long get_info_wid(void);
  317. extern void show_misc_info2(const char *);
  318. extern void hide_misc_info2(void);
  319.  
  320. /* from gl_util.c */
  321. #include "ulib.h"
  322. #include "uproto.h"
  323. #include "gluproto.h"
  324.  
  325. extern int form_single;
  326. extern int always_border;
  327. extern char bitpath[], helppath[];
  328. extern long win_id, win_xo, win_yo, win_w, win_h;
  329.  
  330. #endif /* GUI_H_ */
  331.